package com.demo.fenApi;

import com.demo.entity.AjaxResult;
import com.demo.entity.OrderLog;
import com.demo.entity.TbGoods;
import com.google.common.base.Preconditions;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Objects;

@FeignClient("cloud-goods")
public interface GoodsApi {

    /**
     * 根据id去查询商品详情
     * @param goodsId
     * @return
     */
    @GetMapping("/goods/queryById")
    AjaxResult<TbGoods> queryById(@RequestParam("goodsId") Long goodsId);

    /**
     * 通过id查询商品信息
     *
     * @param tbGoods
     * @return
     */
    @PostMapping("/goods/updateStock")
    AjaxResult updateStock(@RequestBody TbGoods tbGoods);


    @PostMapping("/goods/save/log")
    AjaxResult saveLog(@RequestBody OrderLog orderLog);

}
